Count WWWebula 1.1

Count WWWebula is a graphical access counter CGI for use with Macintosh WWW servers running WebStar or MacHTTP 2.2. If it is installed and running correctly, your WWW pages will display the total number of "hits" or accesses for each page, in the form of a GIF image.

This CGI runs very quickly as it is written in Macintosh C code (using Metrowerks Codewarrior) instead of the AppleScript implementations you might have seen before. The shell of the CGI was created using Grant's CGI Framework by Grant Neufeld.

Note, the application is Shareware. Individuals, educational institutions, and non-profit organizations do not need to send in a Registration Fee (you will get more technical support if you do, however). Commercial companies must send in the Registration Fee, see the included Licensing Agreement. Registered users will receive a copy of Count WWWebula Gold upon request. Count WWWebula Gold (currently in pre-release form) contains several nifty CGIs that you may or may not find a use for on your Mac WWW server.

  • Step-by-Step instructions on set-up.

  • Implementing different digit fonts.

  • How to "pad" the left of the counter gif with zeros.

  • Simple Internet Version Control (SIVC) features.

  • Trouble-shooting.

  • Special thanks.

  • In order to get the CGI up and running you will need to do the following:

    [ It should be noted that much of the following documentation can now be accessed via Apple Guide. To activate it, simply select "Count WWWebula Guide" from the Balloon Help menu when Count WWWebula is the active application. ] Note: In order to view this Apple Guide on pre-7.5 systems, you need to get Apple Guide 2.0 (for those with 7.5 or later, get 2.0 anyway as it adds speed increases and bug fixes). Apple Guide 2.0 is available at Apple's info ftp server.

    (1) Place the folder titled "Counter" inside the folder where you keep the rest of your CGIs and AppleScripts. If you do not have any CGIs inside a folder, it's a good idea to keep them there. In the following example, we'll act like your CGI folder is titled "cgi".

    (2) Inside the "Counter" folder, make sure that the application titled "Counter.acgi" and the folder "digitdir" are in place. Otherwise our example will not function properly.

    (3) Double-Click on the application "Counter.acgi". Once it has been activated, select "Preferences" from the "File" Menu.

    example preferences dialog

    You will now need to delete all the restriction sites in the list box titled "Restrict referrals to URLs containing:", by selecting a site, and clicking the delete key. Now, here's the rough part so stay with me:

    (4) You need to find out what the domain name is of your WebServer, as well as it's IP address. Click on the button titled "New". A dialog box will appear asking you to type in a full or partial domain name or IP address. Type in the full domain name now. (Note: currently this is case sensitive, for most people it will be all lower case letters in the domain name). Click "OK". You should now see the domain name you typed inside the list box of the preferences dialog. Click "New" again. Now type in the numerical IP address and click "OK".

    You have just restricted counter usage to your WebServer. The counter will still be tripped, and viewable by other people, they just cannot use your counter for their page on some remote server. See "Counter Terrorism" at http://www.ac.biola.edu/~chris/counters.html. People like this guy are the main reason why we have all these restrictions.

    Now, if you will also be counting web pages that are NOT on this web server, you must add the domain name and IP address of the server that they are on. Alternately, you can include a partial domain name or IP address. If I wanted anyone at the University of Texas to be able to use/access my counter (a very bad idea, that gives 60,000 people the privilege of using my counter on MY web server.), I would just add "utexas.edu" and "128.83" to the restrictions list. The restrictions work by matching any item in the restrictions list to any portion of the "Refering URL". "Refering URL" meaning a URL to a page that includes your counter on it.

    another example preferences dialog

    (5) If you want it so that anyone who's viewing your web page that is inside a certain domain or ip address, won't affect the count on the counter, put that domain AND ip address in the "Don't count hits from URLs containing:" list. In other words, using the above example as a start, if I don't want anyone in the education building at UT to increment my count of my web page (since I may edit, view, and debug my homepage from any number of machines in the education building), I would put the building's domain name, and ip in the list. If I had my own office computer (which I don't), then I would probably just put that machine's domain name and ip address in the list. That way everyone but me gets counted on the counter.

    (6) If you don't want your CGI to quit after a period of inactivity, put zero in the "Quit CGI after..." box. Otherwise, put how ever many minutes you'd like it to quit after.

    (7) Click "Save" ... this will save your preferences in a preferences file in the "Preferences Folder".

    (8) If you would like to put an access count on your "Default.html" page, open it up in your favorite text or html editor. Include the following line of text somewhere in your document:

    A total of <img src=/cgi/counter/counter.acgi$main/default> people have accessed this page.

    In the "img src" specification, anything after the "$" is an argument that goes to the CGI. The first argument ("main" in this case), is either a user name (if you are running the counter on a WebServer with several persons' WWW pages), or a general topic name. It is needed in order to store multiple page counts that are related, in a single folder. The folder's name will be the name of the first argument ("main" or whatever). You DO NOT NEED TO CREATE ANY FOLDERS!!! The CGI will take care of all the folder creation for you. More on this in a second.

    The second argument is a page index, or some other unique name that you can remember belongs to a specific page's count. I always just use the first name of the html file, "default" in this case. Both the first argument and the second need to be one word only each.

    In my case, there are about 3 different users on one Mac WWW server. So I could just use my first name as the first argument, and whatever page I'm counting as the second. If the page that I'm counting is my personal information page, "personal.html", I would probably include the following in "personal.html":

    A total of <img src=/cgi/counter/counter.acgi$greg/personal> people have accessed this page.

    If you run your own WWW server, and no other users will be using it, you can just use a topical approach to the first argument. If I wanted to add access counters to all the pages in the cryptography section of my homepage, (in this case, the particular page in question would be "crypto_ftp.html") I would do this:

    A total of <img src=/cgi/counter/counter.acgi$crypto/ftp> people have accessed this page.

    Or if the counter were on my Macintosh Cryptography Interface Project (MCIP) page, I would probably include the following in "mcip.html":

    A total of <img src=/cgi/counter/counter.acgi$crypto/mcip> people have accessed this page.

    (9) Once you have added that line of text in your page, save it and put it back on your WWW server.

    (10) Now access that page as you would normally. Note: It's a good idea to access it via a URL instead opening it in Netscape or Mosaic "locally" via a Standard Get File Dialog Box.

    (11) If things went good, you should see a gif looking like an odometer on your homepage. Otherwise, you'll probably see a "Failed" message or "Access Denied". In the case of "Access Denied" you'll want to check your site restrictions in the preferences dialog box. Also, might peek inside the file titled "CountWWWebula Error Log". If can't figure out what went wrong, see my counter homepage at http://uts.cc.utexas.edu/~grgcombs/htmls/counter.html, and if that still doesn't help, send me email and include the "CountWWWebula Error Log" file in the text of your message.

    How to implement different digit gifs:

    If you don't like the odometer digits, or if you'd like several different sets of digits for different pages to end the monotony, you can either create your own, or I have a small archive at http://uts.cc.utexas.edu/~grgcombs/ftp/, and also at http://www.edb.utexas.edu/greg/list_dir.cgi?programming/counter.

    (1) Main thing you need to remember is to copy the "failed.gif" and the "boo.gif" files into your new digit directory. Notice I said "COPY" not "MOVE". If you are creating your own digits, make sure the names match EXACTLY the names of the files in the original "digitdir" folder.

    (2) It's important to point out that any gif digits you may make in a set need to be the same size as each other. In other words digit zero must be the same size as digit 6, etc. (3) Your new digit folder must be located in the same directory as the counter. You can name your new digit directory any name you want, as long as it's only one word (i.e. "digital", "odometer", "funky", or whatever).

    (4) In order to use the gifs you've made, you need to append a "/font=", and the name of your new digit directory on the end of your calling convention, like so:

    A total of <img src=/cgi/counter/counter.acgi$greg/personal/font=digital> people have accessed this page.

    This would be the case if I had a digit directory named "digital" in the same folder as my "Counter.acgi". But please please please make sure that the files "boo.gif" and "failed.gif" exist in your new directory. NOTE: in older versions, instead of using "/font=" you used the "&" character. This is still working. I made it to be backwards compatible so that you don't have to change your web pages if you were using an old version of Count WWWebula.

    How to get the CGI to "pad" the left of the counter gif with zeros:

    Some people didn't like the fact that I took out the padding of the zeros from the last version of Count WWWebula. They said it made the odometer digits look silly without them. So now, you have an option to put them back. If you want all eight digits of the counter to show up in the final gif, zeros and all, do this:

    <img src=/cgi/counter/counter.acgi$greg/personal/font=digital/width=8>

    Or if you'd rather have only four digits show, then do this:

    < img src=/cgi/counter/counter.acgi$greg/personal/font=digital/width=4>

    Of course, you will have to put all your specific information in place of mine, but you get the picture. The width must ALWAYS follow the font in order. Note, you don't necessarily have to have a different font, but if you do, you must have the /width argument show up in the line after the /font argument ....

    Simple Internet Version Control (SIVC) features:

    Simple Internet Version Control is a wonderful little creature. Don't be afraid of it, though at first it may seem dangerous to you, it is completely harmless, and quite helpful.

    What SIVC (pronounce Civic), does, is tell you when a new version of Count WWWebula has been released, and then gives you an option to easily download the new version at the click of a button. It does this by periodically contacting my SIVC server, which keeps track of the latest version of Count WWWebula, as well as it's homepage and the FTP site where it's located. When it contacts the SIVC server, it also allows me to keep an accurate account of the number of people who are using Count WWWebula. You may check the current version information, as well as find out the current total number of users by clicking on the "Current Version Info..." menu item in the File menu. It will contact the server, then produce a dialog like the following:

    SIVC Info DLOG

    Clicking on the "Download" (downloads the latest version for you) or the "Product Information" (opens the counter homepage) button requires you to have Internet Config 1.1 installed on your computer. It needs this so it can find out what Web Broswer and FTP Client you prefer to use. As you can see, the number of known users is shown, as well as the time the total count has been active, and how "sure" it is of it's accuracy. You'll notice that in the above example, it's only 3% sure that there are zero users.... this is because I confused it during testing. After it gets a hand-full or so of users, it will pull back up to a higher accuracy.

    It's important to note that SIVC doesn't send me any private information. I don't ever see your email address, name, type of computer, or what software you might be using. The only thing the SIVC server receives back from the client is the time of first access, and the domain name of the machine on which the client resides. It uses the domain name to keep an accurate account of how many people are using it. That's it.

    If you still feel threatened by SIVC, or you don't want the extra TCP activity, you may disable it by unchecking the checkbox in the application preferences dialog box as shown way above.

    Trouble-Shooting:

    If you have problems setting up the counter, and you've followed all the directions and you still can't figure it out, I've set up a WebPage with FAQs and more documentstion that might help you out:

    http://uts.cc.utexas.edu/~grgcombs/htmls/counter.html
    (or you may click on "Count WWWebula" in the about dialog box)

    If that still doesn't help, find the file titled "CountWWWebula Error Log" (if there is one), and append it to the text of your email message to me, describing the problem.

    For Count WWWebula questions, you can reach me at grgcombs@kagi.com.


    SPECIAL THANKS GO TO:

    Chris W. Johnson and Peter Lewis for the SIVC implementation code.

    Stephen Tallent for the groovy icon.

    Grant Neufeld for all his CGI Framework updates and helpful work on returning binary data to WebStar.

    Daaron Dwyer for helping me with the preferences dialog box.

    Thanks to all the above, and to Chuck Shotton, Ian Bell, Nathan Tableman, and Martin Leach, for helping in the development stages of the application.


    Copyright 1995, Gregory S. Combs
    grgcombs@kagi.com
    http://uts.cc.utexas.edu/~grgcombs/